package com.zhaokuner.springcloudconfigclientone.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;

/**
 * <p>
 * Title:RootCtrl
 * <p>
 * Description:RootCtrl
 * <p>
 * Copyright: 2018-现在 北京掌通未来科技有限公司
 * <p>
 * Date: 2019-08-08 20:31
 *
 * @author 赵希坤 zhaoxikun
 */
@RestController
@RefreshScope
public class RootCtrl {


    @Value("${my.name}")
    private String name;
    @Value("${my.local}")
    private String local;
    @Value("${my.dev}")
    private String dev;
    @Value("${my.alpha}")
    private String alpha;

    @RequestMapping("/hello")
    public Object from() {
        LinkedHashMap<String, String> map = new LinkedHashMap<>(8);
        map.put("name", name);
        map.put("local", local);
        map.put("dev", dev);
        map.put("alpha", alpha);
        return map;
    }

}
